import * as dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.extend(relativeTime)

export default {
  install (Vue) {
    Vue.filter('timeFormat', (time) => {
      // time需要处理的原始的时间信息
      return dayjs().locale('zh-cn').from(time)
    })
  }
}
